package com.main.hotel.service.impl;

import com.main.hotel.entity.Manager;
import com.main.hotel.repository.ManagerRepository;
import com.main.hotel.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Service
@Transactional
public class ManagerServiceImpl implements ManagerService {
    @Autowired
    private ManagerRepository managerRepository;
    @Override
    public Manager getManagerById(Integer manager_id) {
        System.out.println(manager_id);
        return managerRepository.getManagerById(manager_id);
    }

    @Override

    public int addManager(Manager manager) {
        managerRepository.save(manager);
        return 1;
    }

    @Override
    public Manager confirmManager(String phone, String password) {
        Manager manager=managerRepository.confirmManager(phone,password);
        return  manager;
    }
}
